package com.api.syh56.shengyunhui.entity.adminEntity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.annotation.DefaultValue;
import lombok.AccessLevel;
import lombok.Data;
import lombok.experimental.FieldDefaults;

import java.time.LocalDateTime;

/**
 * 工号表
 */
@Data
@FieldDefaults(level = AccessLevel.PRIVATE)
@TableName("adminUser")
public class AdminUser {
    @Column(name = "id",comment = "id")
    Long id;

    /**
     * 用户名/工号
     */
    @Column(name = "username",comment = "用户名")
    String username;

    /**
     * 密码
     */
    @Column(name = "password",comment = "密码")
    String password;

    /**
     * 角色/职务 0 未认证 1 超级管理员  2 管理员  3 客服
     */
    @Column(name = "role",comment = "角色")
    @DefaultValue("0")
    Short role;

    /**
     * 是否启用 0 未启用  1 已启用
     */
    @Column(name = "is_enable",comment = "是否启用")
    @DefaultValue("1")
    Short isEnable;

    /**
     * 真实姓名
     */
    @Column(name = "real_name",comment = "真实姓名")
    String realName;

    /**
     * 手机号
     */
    @Column(name = "phone",comment = "手机号")
    String phone;

    /**
     * 职工id
     */
    @Column(name = "sid",comment = "员工id")
    Long sid;
//    @Column(name = "permission_id",comment = "权限id")
//    Long permissionId;

    @Column(name = "creation_time",comment = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    LocalDateTime creationTime;

    @Column(name = "last_modification_time") // 最后修改时间
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime lastModificationTime;
}
